Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
stackflow-docs | 1b30963 | May 08 2026, 05:50 AM |
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThis PR releases coordinated versions of ChangesHistory Sync Plugin Release
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
extensions/plugin-history-sync/package.json (1)
72-78:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
peerDependencies["@stackflow/core"]minimum version must be bumped to^1.4.0The plugin 1.11.0 reads and writes
stepContext.path— a field introduced onStepPushedEvent/StepReplacedEventin@stackflow/core@1.4.0. The current peer range (^1.1.0-canary.0) allows a consumer to resolve@stackflow/core@1.3.x, which satisfies npm's semver resolution. Under that older core:
- TypeScript will error because
stepContext.pathdoes not exist on the event types.- At runtime the property is silently ignored by the core store, so the URL-encoding regression fix (item 2 in the changelog) is silently defeated.
🔧 Proposed fix
"peerDependencies": { "@stackflow/config": "^1.0.1-canary.0", - "@stackflow/core": "^1.1.0-canary.0", + "@stackflow/core": "^1.4.0", "@stackflow/react": "^1.3.2-canary.0", "@types/react": ">=16.8.0", "react": ">=16.8.0" },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@extensions/plugin-history-sync/package.json` around lines 72 - 78, Update the peerDependencies entry for `@stackflow/core` in package.json to require at least version ^1.4.0 (replace the existing "^1.1.0-canary.0" range) so the plugin can rely on StepPushedEvent/StepReplacedEvent having stepContext.path; modify the peerDependencies block in the extensions/plugin-history-sync package.json accordingly to prevent consumers from resolving older `@stackflow/core` versions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@extensions/plugin-history-sync/package.json`:
- Around line 72-78: Update the peerDependencies entry for `@stackflow/core` in
package.json to require at least version ^1.4.0 (replace the existing
"^1.1.0-canary.0" range) so the plugin can rely on
StepPushedEvent/StepReplacedEvent having stepContext.path; modify the
peerDependencies block in the extensions/plugin-history-sync package.json
accordingly to prevent consumers from resolving older `@stackflow/core` versions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 78fe55a7-0578-4f73-8b5b-7af3bf3f7d45
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (7)
.changeset/coerce-activity-params-to-string.md.changeset/step-context-path.mdcore/CHANGELOG.mdcore/package.jsondocs/components/ChangelogContent.mdxextensions/plugin-history-sync/CHANGELOG.mdextensions/plugin-history-sync/package.json
💤 Files with no reviewable changes (2)
- .changeset/coerce-activity-params-to-string.md
- .changeset/step-context-path.md
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@stackflow/core@1.4.0
Minor Changes
cef9c62: Add optional
stepContext.path?: stringtoStepPushedEventandStepReplacedEvent(purely additive, no breaking change).@stackflow/plugin-history-syncuses this to preserveencode-output URLs through the store across every step navigation path — includingpopstateforward across step boundaries — instead of relying on plugin-internal state.This addresses three regressions surfaced in PR review:
encodeoutput not inhistory.location— post-effect hooks (onPushed/onReplaced/onStepPushed/onStepReplaced/onInit) calledtemplate.fillWithoutEncode(activity.params)against the post-coercion strings, skippingencodeand writing coerced values into the URL. Now they read the encoded URL pre-computed in pre-effect hooks (activityContext.path/stepContext.path), withfillWithoutEncodeas a defensive fallback only.encodecalled with coerced strings on popstate forward re-push — the popstateisForwardandisStepForwardbranches reconstructed push events without preservingactivityContext/stepContext, causingonBeforePush/onBeforeStepPushto calltemplate.fillwith already-coerced strings. Now those branches passactivityContext: targetActivity.context/stepContext: targetStep.context, and the pre-effect hooks short-circuit when the path is already present ("path" in actionParams.activityContext).path(history.location)was never asserted under non-identityencode— every existing test assertedactivity.context.pathonly. Added 15 new tests asserting the URL surface under non-identity encode, including popstate-forward across activity AND step boundaries,defaultHistoryancestor URLs, SSR replay, andreplace-with-active-steps.@stackflow/plugin-history-sync@1.11.0
Minor Changes
cef9c62: Coerce activity/step params to
string | undefinedat the plugin boundary.Before this change,
push("X", { visible: true })would store the booleantruein the core store while URL-arrival parsed the same URL as{ visible: "true" }, souseActivityParams<K>()returned different runtime types depending on how the user reached the activity. This PR coerces non-string values to strings insideplugin-history-sync'sonBeforePush/onBeforeReplace/onBeforeStepPush/onBeforeStepReplacehooks (afterencodeconsumes the typed params to build the URL), and on thedecode-path inoverrideInitialEvents, so the core store always contains{ [key: string]: string | undefined }.encodestill receives the typed paramsUfromtemplate.fill. Post-effect hooks (onPushed,onReplaced,onStepPushed,onStepReplaced,onInit) now use the newfillWithoutEncodeto avoid re-runningencodeon already-coerced store values.This is a behavioral change for consumers that relied on internal push preserving non-string values in the store (a pre-existing divergence from URL-arrival behavior). See the docs update for the migration note.
Migration notes:
decodehook that returns typed values (e.g.decode: (p) => ({ count: Number(p.count) })), those return values are now coerced back to strings in the store to match the declaredActivityBaseParamscontract. Move runtime type coercion to the usage site (Number(useActivityParams().count)).historySyncPluginin the plugins array and that plugin re-injects typed values viaoverrideActionParams, those values will NOT be coerced by this plugin. RegisterhistorySyncPluginlast among plugins that mutateactivityParamsto preserve the string-only invariant.history.state, the params are coerced to strings at hydration time inside theparseStateearly-return. No consumer change required — the post-fix runtime contract (useActivityParams()returnsstring | undefined) holds across version boundaries.Patch Changes
cef9c62: Add optional
stepContext.path?: stringtoStepPushedEventandStepReplacedEvent(purely additive, no breaking change).@stackflow/plugin-history-syncuses this to preserveencode-output URLs through the store across every step navigation path — includingpopstateforward across step boundaries — instead of relying on plugin-internal state.This addresses three regressions surfaced in PR review:
encodeoutput not inhistory.location— post-effect hooks (onPushed/onReplaced/onStepPushed/onStepReplaced/onInit) calledtemplate.fillWithoutEncode(activity.params)against the post-coercion strings, skippingencodeand writing coerced values into the URL. Now they read the encoded URL pre-computed in pre-effect hooks (activityContext.path/stepContext.path), withfillWithoutEncodeas a defensive fallback only.encodecalled with coerced strings on popstate forward re-push — the popstateisForwardandisStepForwardbranches reconstructed push events without preservingactivityContext/stepContext, causingonBeforePush/onBeforeStepPushto calltemplate.fillwith already-coerced strings. Now those branches passactivityContext: targetActivity.context/stepContext: targetStep.context, and the pre-effect hooks short-circuit when the path is already present ("path" in actionParams.activityContext).path(history.location)was never asserted under non-identityencode— every existing test assertedactivity.context.pathonly. Added 15 new tests asserting the URL surface under non-identity encode, including popstate-forward across activity AND step boundaries,defaultHistoryancestor URLs, SSR replay, andreplace-with-active-steps.